using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using UMC.Data;

namespace UMC.WorkFlow.Subassembly
{
    /// <summary>
    /// 
    /// </summary>
    [UMC.WorkFlow.DefaultDesign(ArgumentType = UMC.WorkFlow.ArgumentType.Command, ArgumentValue = "SqlSetting")]
    public class SqlStatusSetting : SqlSetting
    {
        public UMC.WorkFlow.CommandType CommandType
        {
            get;
            set;
        }
        public override void Read(string key, object value)
        {
            switch (key)
            {
                default:
                    base.Read(key, value);
                    break;
                case "CommandType":
                    this.CommandType = Utility.Parse(value as string, CommandType.Undefine);
                    break;

            }
        }
        protected override void WriteProperty(TextWriter writer)
        {
            if (this.CommandType > CommandType.Undefine)
            {
                writer.Write(',');
                JSON.Serialize("CommandType", this.CommandType, writer);
            }
            base.WriteProperty(writer);
        }
    }
}
